<?php

namespace Biz\model\advertisement;

class MHhzPositionStartApp extends MBaseDbModel
{
    const _CONFIG_FILE_ = 'db_position';

    const _CONFIG_SELECT_ = 'db_position';

    const _DATABASE_ = 'hhz_position';

    const _TABLE_NAME = 'hhz_position_start_app';

    const FULL_SCREEN_NORMAL = 1;
    const FULL_SCREEN = 2;

    const MATERIAL_TYPE_PIC = 1;
    const MATERIAL_TYPE_AD = 2;
    const MATERIAL_TYPE_VEDIO = 3;

    const VEDIO_ORIGIN = 'ori_play_url';//原画播放地址
    const VEDIO_PLAY = 'play_url';//流畅播放地址
    const VEDIO_WITH_WATER = 'water_play_url';//带水印播放地址

    const MATERIAL_TYPE_MAP = [
        self::MATERIAL_TYPE_PIC => '图片',
        self::MATERIAL_TYPE_AD => '广告',
        self::MATERIAL_TYPE_VEDIO => '视频',
    ];

    const VEDIO_TYPE_LIST = [
        self::VEDIO_ORIGIN => '原画播放地址',
        self::VEDIO_PLAY => '流畅播放地址',
        self::VEDIO_WITH_WATER => '带水印播放地址',
    ];
    const FULL_SCREEN_MAP = [
        self::FULL_SCREEN_NORMAL => '非全屏',
        self::FULL_SCREEN => '全屏',
    ];


    /**
     * @param array $typeList
     * @return array
     */
    public static function getVedioTypeList($typeList = [])
    {
        $map = self::VEDIO_TYPE_LIST;
        $response = [];
        foreach ($typeList as $type) {
            $response[$type] = $map[$type] ?? $type;
        }
        return $response;
    }
}

